USE [Clinic]
GO
/****** Object:  StoredProcedure [dbo].[up_BioInsert]    Script Date: 02/04/2008 21:42:22 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[up_ReminderInsert]
		  @Date datetime
		, @PatientID int
AS
BEGIN
	SET NOCOUNT ON;
	INSERT INTO [Reminder]
	(
		  [Date]  
		, [PatientID]  
	)
	VALUES
	(
			  @Date
			, @PatientID
	) 
END

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[up_ReminderGetAll]
AS
BEGIN
SET NOCOUNT ON;

	SELECT p.Telephone, r.Date, (p.[Name] + ' ' + p.LastName) AS PatientName
	FROM Patients p
	INNER JOIN Reminder r
	ON p.PatientID = r.PatientID and r.Date BETWEEN GETDATE()+1 and GETDATE()+ 3
END
